"use strict";

/**
 * @auther wtfssd
 * Created by wtfssd on 2017/11/8
 */
import * as React from 'react'
import {SCREEN_HEIGHT, SCREEN_WIDTH} from "../constant";
import {autoSize, commonStyles} from "../assets/styles/common";
import MyText from "./MyText";
import Colors from "../assets/styles/Colors";
import {AuthHeaderProps} from "./index";

const {View, ART} = require('react-native');
const { Surface , Group , Shape , Path } = ART;
const {connect} = require('react-redux');

class AuthHeader extends React.Component<AuthHeaderProps, any> {


    static defaultProps = {
        text:'轻生活'
    };

    render() {
        const path = Path( `M0 0 H${SCREEN_WIDTH} V${autoSize(180)} C${autoSize(210.25)} ${autoSize(120)} ${autoSize(93.75)} ${autoSize(220)} 0 ${autoSize(180)}` ).close();
        return (
            <View style={[commonStyles.centerVH,commonStyles.relative]}>
                <Surface width={SCREEN_WIDTH} height={autoSize(227)}>
                    <Group>
                        <Shape d={path} stroke="#fff" strokeWidth={0} fill={Colors.Primary}/>
                    </Group>
                </Surface>
                <MyText style={[commonStyles.absolute,{backgroundColor:'transparent'}]}
                        color={'#fff'} fontSize={30}>{this.props.text}</MyText>
            </View>
        );
    }
}


export default AuthHeader;